package com.heima.behavior.controller.v1;

import com.alibaba.fastjson.JSON;
import com.heima.behavior.service.BehaviorLikeService;
import com.heima.common.redis.BehaviorConstants;
import com.heima.model.behavior.dtos.LikesBehaviorDto;
import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.common.enums.AppHttpCodeEnum;
import com.heima.utils.thread.ApThreadLocalUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.*;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;



@Slf4j
@RestController
@RequestMapping("/api/v1")
public class BehaviorLikeController {


    @Autowired
    private BehaviorLikeService behaviorLikeService;

    /**
     * 点赞功能
     * @param dto
     * @return
     */
    @PostMapping("likes_behavior")
    public ResponseResult behaviorLike(@RequestBody LikesBehaviorDto dto) {
        return behaviorLikeService.behaviorLike(dto);
    }
}
